//
//  ItemPassTableViewCell.m
//  LaiKeDaoClient
//
//  Created by zouzhisheng on 15/11/29.
//  Copyright © 2015年 LKD. All rights reserved.
//

#import "ItemPassTableViewCell.h"

@implementation ItemPassTableViewCell

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}
- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self createUI];
    }
    return self;
}

- (void)createUI
{
    self.headImageView = [[UIImageView alloc] initWithFrame:(CGRect){10,15,44,44}];
    [self.headImageView setImage:[UIImage imageNamed:@"ic_pic.png"]];
    self.headImageView.layer.cornerRadius = 5;
    self.headImageView.layer.masksToBounds = YES;
    [self.contentView addSubview:_headImageView];
    
    self.nameLabel = [[UILabel alloc] initWithFrame:(CGRect){X(_headImageView)+WIDTH(_headImageView)+10,Y(_headImageView),200,20}];
    [_nameLabel setTextAlignment:NSTextAlignmentLeft];
    [_nameLabel setFont:[UIFont systemFontOfSize:15]];
    [_nameLabel setBackgroundColor:[UIColor clearColor]];
    [_nameLabel setText:@"赵云"];
    [self.contentView addSubview:_nameLabel];
    
    self.timeLabel = [[UILabel alloc] initWithFrame:(CGRect){kScreenWidth-110,Y(_headImageView),100,20}];
    [_timeLabel setTextAlignment:NSTextAlignmentRight];
    [_timeLabel setFont:[UIFont systemFontOfSize:12]];
    [_timeLabel setBackgroundColor:[UIColor clearColor]];
    [_timeLabel setTextColor:[UIColor colorWithHexString:@"cccccc"]];
    [_timeLabel setText:@"10:01"];
    [self.contentView addSubview:_timeLabel];
    UILabel     *label1= [[UILabel alloc] initWithFrame:(CGRect){X(_nameLabel),_nameLabel.bottom,50,20}];
    [label1 setTextAlignment:NSTextAlignmentLeft];
    [label1 setFont:[UIFont systemFontOfSize:12]];
    [label1 setBackgroundColor:[UIColor clearColor]];
    [label1 setText:@"创建项目"];
    [label1 setTextColor:[UIColor colorWithHexString:@"666666"]];
    [self.contentView addSubview:label1];
    
    self.time2Label = [[UILabel alloc] initWithFrame:(CGRect){X(label1)+WIDTH(label1),Y(label1),100,20}];
    self.left=label1.right+9;
    self.top=label1.top;
    [_time2Label setTextAlignment:NSTextAlignmentCenter];
    [_time2Label setFont:[UIFont systemFontOfSize:12]];
    [_time2Label setBackgroundColor:[UIColor colorWithHexString:@"ff8b01"]];
    [_time2Label setTextColor:[UIColor whiteColor]];
    _time2Label.layer.cornerRadius = 5;//设置那个圆角的有多圆
    _time2Label.layer.masksToBounds = YES;
    [self.contentView addSubview:_time2Label];
    
    UIImageView *checkImageView=[[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 11, 8)];
    checkImageView.left=label1.left;
    checkImageView.top=label1.bottom+7;
    checkImageView.image=[UIImage imageNamed:@"ic_pass"];
    [self.contentView addSubview:checkImageView];
    
    UILabel *tLable=[[UILabel alloc] initWithFrame:CGRectMake(0, 0, 100,20)];
    tLable.left=checkImageView.right+6;
    tLable.top=checkImageView.top-6;
    [tLable setTextColor:[UIColor colorWithHexString:@"666666"]];
    [tLable setFont:[UIFont systemFontOfSize:12]];
    tLable.text=@"已同意你的申请";
    [self.contentView addSubview:tLable];
}

@end
